\(\int \cot ^5(c+d x) \csc (c+d x) (a+b \sin (c+d x))^2 \, dx\) [1222]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 27, antiderivative size = 124 \[ \int \cot ^5(c+d x) \csc (c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {\left (a^2-2 b^2\right ) \csc (c+d x)}{d}+\frac {2 a b \csc ^2(c+d x)}{d}+\frac {\left (2 a^2-b^2\right ) \csc ^3(c+d x)}{3 d}-\frac {a b \csc ^4(c+d x)}{2 d}-\frac {a^2 \csc ^5(c+d x)}{5 d}+\frac {2 a b \log (\sin (c+d x))}{d}+\frac {b^2 \sin (c+d x)}{d} \]

[Out]

-(a^2-2*b^2)*csc(d*x+c)/d+2*a*b*csc(d*x+c)^2/d+1/3*(2*a^2-b^2)*csc(d*x+c)^3/d-1/2*a*b*csc(d*x+c)^4/d-1/5*a^2*c
sc(d*x+c)^5/d+2*a*b*ln(sin(d*x+c))/d+b^2*sin(d*x+c)/d

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 124, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2916, 12, 962} \[ \int \cot ^5(c+d x) \csc (c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {\left (2 a^2-b^2\right ) \csc ^3(c+d x)}{3 d}-\frac {\left (a^2-2 b^2\right ) \csc (c+d x)}{d}-\frac {a^2 \csc ^5(c+d x)}{5 d}-\frac {a b \csc ^4(c+d x)}{2 d}+\frac {2 a b \csc ^2(c+d x)}{d}+\frac {2 a b \log (\sin (c+d x))}{d}+\frac {b^2 \sin (c+d x)}{d} \]

[In]

Int[Cot[c + d*x]^5*Csc[c + d*x]*(a + b*Sin[c + d*x])^2,x]

[Out]

-(((a^2 - 2*b^2)*Csc[c + d*x])/d) + (2*a*b*Csc[c + d*x]^2)/d + ((2*a^2 - b^2)*Csc[c + d*x]^3)/(3*d) - (a*b*Csc
[c + d*x]^4)/(2*d) - (a^2*Csc[c + d*x]^5)/(5*d) + (2*a*b*Log[Sin[c + d*x]])/d + (b^2*Sin[c + d*x])/d

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 962

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IGtQ[p, 0] && (IGtQ[m, 0] || (EqQ[m, -2] && EqQ[p, 1] && EqQ[d, 0]))

Rule 2916

Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)
*(x_)])^(n_.), x_Symbol] :> Dist[1/(b^p*f), Subst[Int[(a + x)^m*(c + (d/b)*x)^n*(b^2 - x^2)^((p - 1)/2), x], x
, b*Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IntegerQ[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {b^6 (a+x)^2 \left (b^2-x^2\right )^2}{x^6} \, dx,x,b \sin (c+d x)\right )}{b^5 d} \\ & = \frac {b \text {Subst}\left (\int \frac {(a+x)^2 \left (b^2-x^2\right )^2}{x^6} \, dx,x,b \sin (c+d x)\right )}{d} \\ & = \frac {b \text {Subst}\left (\int \left (1+\frac {a^2 b^4}{x^6}+\frac {2 a b^4}{x^5}+\frac {-2 a^2 b^2+b^4}{x^4}-\frac {4 a b^2}{x^3}+\frac {a^2-2 b^2}{x^2}+\frac {2 a}{x}\right ) \, dx,x,b \sin (c+d x)\right )}{d} \\ & = -\frac {\left (a^2-2 b^2\right ) \csc (c+d x)}{d}+\frac {2 a b \csc ^2(c+d x)}{d}+\frac {\left (2 a^2-b^2\right ) \csc ^3(c+d x)}{3 d}-\frac {a b \csc ^4(c+d x)}{2 d}-\frac {a^2 \csc ^5(c+d x)}{5 d}+\frac {2 a b \log (\sin (c+d x))}{d}+\frac {b^2 \sin (c+d x)}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.13 (sec) , antiderivative size = 105, normalized size of antiderivative = 0.85 \[ \int \cot ^5(c+d x) \csc (c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {-30 \left (a^2-2 b^2\right ) \csc (c+d x)+60 a b \csc ^2(c+d x)+10 \left (2 a^2-b^2\right ) \csc ^3(c+d x)-15 a b \csc ^4(c+d x)-6 a^2 \csc ^5(c+d x)+30 b (2 a \log (\sin (c+d x))+b \sin (c+d x))}{30 d} \]

[In]

Integrate[Cot[c + d*x]^5*Csc[c + d*x]*(a + b*Sin[c + d*x])^2,x]

[Out]

(-30*(a^2 - 2*b^2)*Csc[c + d*x] + 60*a*b*Csc[c + d*x]^2 + 10*(2*a^2 - b^2)*Csc[c + d*x]^3 - 15*a*b*Csc[c + d*x
]^4 - 6*a^2*Csc[c + d*x]^5 + 30*b*(2*a*Log[Sin[c + d*x]] + b*Sin[c + d*x]))/(30*d)

Maple [A] (verified)

Time = 0.47 (sec) , antiderivative size = 115, normalized size of antiderivative = 0.93

method result size
derivativedivides \(-\frac {\frac {\left (\csc ^{5}\left (d x +c \right )\right ) a^{2}}{5}+\frac {a b \left (\csc ^{4}\left (d x +c \right )\right )}{2}-\frac {2 a^{2} \left (\csc ^{3}\left (d x +c \right )\right )}{3}+\frac {b^{2} \left (\csc ^{3}\left (d x +c \right )\right )}{3}-2 a b \left (\csc ^{2}\left (d x +c \right )\right )+\csc \left (d x +c \right ) a^{2}-2 \csc \left (d x +c \right ) b^{2}-\frac {b^{2}}{\csc \left (d x +c \right )}+2 a b \ln \left (\csc \left (d x +c \right )\right )}{d}\) \(115\)
default \(-\frac {\frac {\left (\csc ^{5}\left (d x +c \right )\right ) a^{2}}{5}+\frac {a b \left (\csc ^{4}\left (d x +c \right )\right )}{2}-\frac {2 a^{2} \left (\csc ^{3}\left (d x +c \right )\right )}{3}+\frac {b^{2} \left (\csc ^{3}\left (d x +c \right )\right )}{3}-2 a b \left (\csc ^{2}\left (d x +c \right )\right )+\csc \left (d x +c \right ) a^{2}-2 \csc \left (d x +c \right ) b^{2}-\frac {b^{2}}{\csc \left (d x +c \right )}+2 a b \ln \left (\csc \left (d x +c \right )\right )}{d}\) \(115\)
parallelrisch \(\frac {-384 \ln \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b +384 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b +\left (a^{2} \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (\cos \left (2 d x +2 c \right )-\frac {3 \cos \left (4 d x +4 c \right )}{4}-\frac {29}{20}\right ) \left (\csc ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {39 b \left (\cos \left (2 d x +2 c \right )+\frac {19 \cos \left (4 d x +4 c \right )}{52}-\frac {7}{52}\right ) \sec \left (\frac {d x}{2}+\frac {c}{2}\right ) a \csc \left (\frac {d x}{2}+\frac {c}{2}\right )}{8}-36 b^{2} \left (\cos \left (2 d x +2 c \right )-\frac {\cos \left (4 d x +4 c \right )}{12}-\frac {25}{36}\right )\right ) \left (\csc ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (\sec ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{192 d}\) \(180\)
risch \(-2 i x a b -\frac {i b^{2} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} b^{2}}{2 d}-\frac {4 i a b c}{d}-\frac {2 i \left (15 a^{2} {\mathrm e}^{9 i \left (d x +c \right )}-30 b^{2} {\mathrm e}^{9 i \left (d x +c \right )}-20 a^{2} {\mathrm e}^{7 i \left (d x +c \right )}+100 b^{2} {\mathrm e}^{7 i \left (d x +c \right )}-60 i a b \,{\mathrm e}^{8 i \left (d x +c \right )}+58 a^{2} {\mathrm e}^{5 i \left (d x +c \right )}-140 b^{2} {\mathrm e}^{5 i \left (d x +c \right )}+120 i a b \,{\mathrm e}^{6 i \left (d x +c \right )}-20 a^{2} {\mathrm e}^{3 i \left (d x +c \right )}+100 b^{2} {\mathrm e}^{3 i \left (d x +c \right )}-120 i a b \,{\mathrm e}^{4 i \left (d x +c \right )}+15 a^{2} {\mathrm e}^{i \left (d x +c \right )}-30 b^{2} {\mathrm e}^{i \left (d x +c \right )}+60 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}\right )}{15 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{5}}+\frac {2 a b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}\) \(288\)
norman \(\frac {-\frac {a^{2}}{160 d}-\frac {a^{2} \left (\tan ^{14}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{160 d}-\frac {5 \left (17 a^{2}-88 b^{2}\right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{96 d}-\frac {5 \left (17 a^{2}-88 b^{2}\right ) \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{96 d}+\frac {\left (19 a^{2}-20 b^{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{480 d}+\frac {\left (19 a^{2}-20 b^{2}\right ) \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{480 d}-\frac {\left (103 a^{2}-380 b^{2}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{480 d}-\frac {\left (103 a^{2}-380 b^{2}\right ) \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{480 d}-\frac {11 a b \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{16 d}-\frac {a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{32 d}+\frac {5 a b \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{16 d}+\frac {5 a b \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{16 d}-\frac {a b \left (\tan ^{13}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{32 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {2 a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 a b \ln \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) \(345\)

[In]

int(cos(d*x+c)^5*csc(d*x+c)^6*(a+b*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

-1/d*(1/5*csc(d*x+c)^5*a^2+1/2*a*b*csc(d*x+c)^4-2/3*a^2*csc(d*x+c)^3+1/3*b^2*csc(d*x+c)^3-2*a*b*csc(d*x+c)^2+c
sc(d*x+c)*a^2-2*csc(d*x+c)*b^2-b^2/csc(d*x+c)+2*a*b*ln(csc(d*x+c)))

Fricas [A] (verification not implemented)

none

Time = 0.40 (sec) , antiderivative size = 166, normalized size of antiderivative = 1.34 \[ \int \cot ^5(c+d x) \csc (c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {30 \, b^{2} \cos \left (d x + c\right )^{6} + 30 \, {\left (a^{2} - 5 \, b^{2}\right )} \cos \left (d x + c\right )^{4} - 40 \, {\left (a^{2} - 5 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 60 \, {\left (a b \cos \left (d x + c\right )^{4} - 2 \, a b \cos \left (d x + c\right )^{2} + a b\right )} \log \left (\frac {1}{2} \, \sin \left (d x + c\right )\right ) \sin \left (d x + c\right ) + 16 \, a^{2} - 80 \, b^{2} + 15 \, {\left (4 \, a b \cos \left (d x + c\right )^{2} - 3 \, a b\right )} \sin \left (d x + c\right )}{30 \, {\left (d \cos \left (d x + c\right )^{4} - 2 \, d \cos \left (d x + c\right )^{2} + d\right )} \sin \left (d x + c\right )} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)^6*(a+b*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

-1/30*(30*b^2*cos(d*x + c)^6 + 30*(a^2 - 5*b^2)*cos(d*x + c)^4 - 40*(a^2 - 5*b^2)*cos(d*x + c)^2 - 60*(a*b*cos
(d*x + c)^4 - 2*a*b*cos(d*x + c)^2 + a*b)*log(1/2*sin(d*x + c))*sin(d*x + c) + 16*a^2 - 80*b^2 + 15*(4*a*b*cos
(d*x + c)^2 - 3*a*b)*sin(d*x + c))/((d*cos(d*x + c)^4 - 2*d*cos(d*x + c)^2 + d)*sin(d*x + c))

Sympy [F(-1)]

Timed out. \[ \int \cot ^5(c+d x) \csc (c+d x) (a+b \sin (c+d x))^2 \, dx=\text {Timed out} \]

[In]

integrate(cos(d*x+c)**5*csc(d*x+c)**6*(a+b*sin(d*x+c))**2,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 105, normalized size of antiderivative = 0.85 \[ \int \cot ^5(c+d x) \csc (c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {60 \, a b \log \left (\sin \left (d x + c\right )\right ) + 30 \, b^{2} \sin \left (d x + c\right ) + \frac {60 \, a b \sin \left (d x + c\right )^{3} - 30 \, {\left (a^{2} - 2 \, b^{2}\right )} \sin \left (d x + c\right )^{4} - 15 \, a b \sin \left (d x + c\right ) + 10 \, {\left (2 \, a^{2} - b^{2}\right )} \sin \left (d x + c\right )^{2} - 6 \, a^{2}}{\sin \left (d x + c\right )^{5}}}{30 \, d} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)^6*(a+b*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

1/30*(60*a*b*log(sin(d*x + c)) + 30*b^2*sin(d*x + c) + (60*a*b*sin(d*x + c)^3 - 30*(a^2 - 2*b^2)*sin(d*x + c)^
4 - 15*a*b*sin(d*x + c) + 10*(2*a^2 - b^2)*sin(d*x + c)^2 - 6*a^2)/sin(d*x + c)^5)/d

Giac [A] (verification not implemented)

none

Time = 0.40 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.06 \[ \int \cot ^5(c+d x) \csc (c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {60 \, a b \log \left ({\left | \sin \left (d x + c\right ) \right |}\right ) + 30 \, b^{2} \sin \left (d x + c\right ) - \frac {137 \, a b \sin \left (d x + c\right )^{5} + 30 \, a^{2} \sin \left (d x + c\right )^{4} - 60 \, b^{2} \sin \left (d x + c\right )^{4} - 60 \, a b \sin \left (d x + c\right )^{3} - 20 \, a^{2} \sin \left (d x + c\right )^{2} + 10 \, b^{2} \sin \left (d x + c\right )^{2} + 15 \, a b \sin \left (d x + c\right ) + 6 \, a^{2}}{\sin \left (d x + c\right )^{5}}}{30 \, d} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)^6*(a+b*sin(d*x+c))^2,x, algorithm="giac")

[Out]

1/30*(60*a*b*log(abs(sin(d*x + c))) + 30*b^2*sin(d*x + c) - (137*a*b*sin(d*x + c)^5 + 30*a^2*sin(d*x + c)^4 -
60*b^2*sin(d*x + c)^4 - 60*a*b*sin(d*x + c)^3 - 20*a^2*sin(d*x + c)^2 + 10*b^2*sin(d*x + c)^2 + 15*a*b*sin(d*x
 + c) + 6*a^2)/sin(d*x + c)^5)/d

Mupad [B] (verification not implemented)

Time = 11.41 (sec) , antiderivative size = 297, normalized size of antiderivative = 2.40 \[ \int \cot ^5(c+d x) \csc (c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {5\,a^2}{96}-\frac {b^2}{24}\right )}{d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {5\,a^2}{16}-\frac {7\,b^2}{8}\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (10\,a^2-92\,b^2\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {22\,a^2}{15}-\frac {4\,b^2}{3}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (\frac {25\,a^2}{3}-\frac {80\,b^2}{3}\right )+\frac {a^2}{5}-11\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-12\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (32\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+32\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\right )}-\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{160\,d}+\frac {3\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}-\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{32\,d}+\frac {2\,a\,b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {2\,a\,b\,\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{d} \]

[In]

int((cos(c + d*x)^5*(a + b*sin(c + d*x))^2)/sin(c + d*x)^6,x)

[Out]

(tan(c/2 + (d*x)/2)^3*((5*a^2)/96 - b^2/24))/d - (tan(c/2 + (d*x)/2)*((5*a^2)/16 - (7*b^2)/8))/d - (tan(c/2 +
(d*x)/2)^6*(10*a^2 - 92*b^2) - tan(c/2 + (d*x)/2)^2*((22*a^2)/15 - (4*b^2)/3) + tan(c/2 + (d*x)/2)^4*((25*a^2)
/3 - (80*b^2)/3) + a^2/5 - 11*a*b*tan(c/2 + (d*x)/2)^3 - 12*a*b*tan(c/2 + (d*x)/2)^5 + a*b*tan(c/2 + (d*x)/2))
/(d*(32*tan(c/2 + (d*x)/2)^5 + 32*tan(c/2 + (d*x)/2)^7)) - (a^2*tan(c/2 + (d*x)/2)^5)/(160*d) + (3*a*b*tan(c/2
 + (d*x)/2)^2)/(8*d) - (a*b*tan(c/2 + (d*x)/2)^4)/(32*d) + (2*a*b*log(tan(c/2 + (d*x)/2)))/d - (2*a*b*log(tan(
c/2 + (d*x)/2)^2 + 1))/d